package com.example.designModel.observe.enhance;


/**
 * 利用方法委派结合观察者模式
 */
public class Main {
    public static void main(String[] args) {

        BossEnhance bossEnhance = new BossEnhance();
        StockObserver tongshi1 = new StockObserver("张三", bossEnhance);
        NBAObserver tongshi2 = new NBAObserver("李四", bossEnhance);
        bossEnhance.setActionStatus("我胡汉三回来了!");
        bossEnhance.addListener(tongshi1,"close","呵呵");
        bossEnhance.addListener(tongshi2,"close","哈哈");
        bossEnhance.notifyX();
    }
}
